

#ifndef _MEMBER_BSWITCHER_H_
#define _MEMBER_BSWITCHER_H_

#include <BRect>
#include <BArray>
#include <BButton>
#include <BLayout>
#include <BSwitcher>

namespace BWE
{
	class SwitchItem
	{
	public:
		SwitchItem()
		{

		}
		bool able() const
		{
			if (button)
				return button->able();
			return false;
		}

		BButtonHolder	button;
		BRect			rect;//area rect;
		BRect			indictorRect;
		BRect			imageRect;
		BRect			textRect;
		BPoint			lineLoop[12];
	};
	class member_BSwitcher : public BObject
	{
	public:
		member_BSwitcher(BSwitcher* switcher);
		~member_BSwitcher();

		bool contains(BButton* button) const;

		BButton* buttonAt(const BPoint& pos);
		
		void procButtonChecked(BObject* button, const BValue& value);

		BSwitcher*				boss;
		Align					align;
		int						space;
		bool					pressed;
		int						hoveredIndex;
		Orientation				orientation;
		BArray<SwitchItem>		items;
		BButton*				checkedButton;
	};
}

#endif